package com.oedtech.esl.controller;

import com.oedtech.esl.exception.NotExcelException;
import com.oedtech.esl.json.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Controller

public class IndexController extends BaseController{




    @RequestMapping("/")
    public String index(Model model){
        Authentication auth= SecurityContextHolder.getContext().getAuthentication();
        model.addAttribute("user",auth.getPrincipal());
        return "redirect:/esl_manager";
    }




    @GetMapping(value = "/login")
    public String login2() {
        return "login";
    }

    //商品绑定标签页面
    @RequestMapping("/esl_manager")
    public String toEslManager( Model model){
        Authentication auth= SecurityContextHolder.getContext().getAuthentication();
        model.addAttribute("user",auth.getPrincipal());
        return "manager/esl_manager";
    }
    //商品绑定标签页面
    @RequestMapping("/ap_manager")
    public String toApManager( Model model){
        Authentication auth= SecurityContextHolder.getContext().getAuthentication();
        model.addAttribute("user",auth.getPrincipal());
        return "manager/ap_manager";
    }
}


